﻿namespace EyeOpen.IO
{
	using System.Collections.Generic;
	using System.IO;
	using System.Linq;

	internal class DirectoryInfoWrapper 
		: IDirectoryInfo
	{
		private readonly DirectoryInfo directory;

		public DirectoryInfoWrapper(DirectoryInfo directory)
		{
			this.directory = directory;
		}

		public string FullName
		{
			get { return directory.FullName; }
		}

		public IEnumerable<FileInfo> GetFiles(string fileName)
		{
			return directory.GetFiles(fileName);
		}

		public IEnumerable<IDirectoryInfo> GetDirectories()
		{
			return
				directory
					.GetDirectories()
					.Select(d => new DirectoryInfoWrapper(d));
		}
	}
}